package com.gitee.xzb617.mybatis.sqllog;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
@ConfigurationProperties(prefix = "sql-log")
public class SqlLogProperties {

    // 是否开启 fsp 打印
    private Boolean enabled = true;

    // 是否开启异步打印
    private Boolean supportAsync = true;

    // "com.hexgon.proj"
    private List<String> packageMatchRules = new ArrayList<>();

    // 定时任务、监听器等内部直接调用sql的匹配规则
    private List<String> innerInvokeMatchRules = new ArrayList<>();

    // 当结果集大于本阈值时，后续的结果数据将不再展示
    private Integer showResultCountWhen = 3;

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public Boolean getSupportAsync() {
        return supportAsync;
    }

    public void setSupportAsync(Boolean supportAsync) {
        this.supportAsync = supportAsync;
    }

    public List<String> getPackageMatchRules() {
        return packageMatchRules;
    }

    public void setPackageMatchRules(List<String> packageMatchRules) {
        this.packageMatchRules = packageMatchRules;
    }

    public Integer getShowResultCountWhen() {
        return showResultCountWhen;
    }

    public void setShowResultCountWhen(Integer showResultCountWhen) {
        this.showResultCountWhen = showResultCountWhen;
    }

    public List<String> getInnerInvokeMatchRules() {
        return innerInvokeMatchRules;
    }

    public void setInnerInvokeMatchRules(List<String> innerInvokeMatchRules) {
        this.innerInvokeMatchRules = innerInvokeMatchRules;
    }

}
